package com.taiyo;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;
import org.springframework.boot.builder.SpringApplicationBuilder;
import org.springframework.boot.web.client.RestTemplateBuilder;
import org.springframework.boot.web.support.SpringBootServletInitializer;
import org.springframework.context.annotation.Bean;
import org.springframework.web.client.RestTemplate;


@SpringBootApplication
public class TaiyoApplication extends SpringBootServletInitializer{
	@Autowired
	private RestTemplateBuilder builder;
	@Bean
	public RestTemplate restTemplate() {
		return builder.build();
	}
	
	public static void main(String[] args) {
		SpringApplication.run(TaiyoApplication.class, args);
	}
	@Override
    protected SpringApplicationBuilder configure(SpringApplicationBuilder application) {
        return application.sources(TaiyoApplication.class);
    }
}
